﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Galoap
{
    public partial class ImageTagJSONEncoder : JSONEncoder
    {

        public ImageTagJSONEncoder(Question q) {
            question = q;
        } 

        public override string GetJSON()
        {
            StringBuilder sb = new StringBuilder("\"help\":\"" + ((ImageTagQuestion)question).Help + "\",");
            sb.Append("\"taboo\":[");
            foreach (StringAnswer a in ((ImageTagQuestion)question).Taboo)
            {
                sb.Append("\"" + a.ToString() + "\",");
            }
            if (((ImageTagQuestion)question).Taboo.Count > 0) sb.Remove(sb.Length - 1, 1);
            sb.Append("]");
            return ("{" + base.GetJSON() + ",\"subclass\":{" + sb.ToString() + "}" + "}");
        }

    }
}
